<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>执行SQL语句 - 苹果CMS</title>
<link rel="stylesheet" type="text/css" href="tpl/images/style.css" />
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jq/jquery.cookie.js"></script>
<script type="text/javascript" src="../js/jq/jquery.validate.js"></script>
<script type="text/javascript" src="tpl/js/adm.js"></script>
<script language="javascript">
$(function(){
	$("#form1").validate({
		rules:{
			sql:{required:true}
		}
	});
});
</script>
</head>
<body>
<form action="?m=db-sqlexe" method="post" name="form1" id="form1"><table class="tb">
<tr><td><textarea name="sql" type="text" id="sql" rows="20" style="width:100%"></textarea></td></tr><tr><td><input class="input" type="submit" value="执行" name="Submit"></td></tr><tr><td valign="top" ><strong><br>常用语句对照<br></strong><br><strong>1.查询数据</strong><br>
SELECT * FROM {pre}vod&nbsp;&nbsp; 查询所有数据<br>
SELECT * FROM {pre}vod WHERE d_id=1000&nbsp;&nbsp; 查询指定ID数据<br>
<strong>2.删除数据</strong><br>
DELETE FROM {pre}vod&nbsp;&nbsp; 删除所有数据<br>
DELETE FROM {pre}vod WHERE d_id=1000 &nbsp; 删除指定的第几条数据<br>
DELETE FROM {pre}vod WHERE d_starring LIKE '%刘德华%'&nbsp;&nbsp; 删除d_starring字段里有&quot;刘德华&quot;的数据<br>
<strong>&nbsp;3.修改数据</strong><br>
UPDATE {pre}vod SET d_hits=1&nbsp;&nbsp; 将所有d_hits字段里的值修改成&quot;1&quot;<br>
UPDATE {pre}vod SET d_hits=1 WHERE d_id=1000&nbsp; 指定的第几条数据把d_hits字段里的值修改成&quot;1&quot; <br>
<strong>&nbsp;4.替换图片地址</strong><br>
UPDATE {pre}vod SET d_pic=REPLACE(d_pic, '原始字符串', '替换成其他字符串')<br>
<strong>&nbsp;5.清空数据ID重新从1开始</strong><br>
TRUNCATE {pre}vod<br>

</td></tr></table></form>
{foot}
</body>
</html>